<style type="text/css">
    .left-panel {
        float: left;
        width: 75%;
    }

    .right-panel {
        float: right;
        width: 20%;
        padding-left: 40px;
    }
</style>

<script type="text/javascript" src="<?php echo Yii::app()->baseUrl ?>/scripts/jquery/jquery.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("#name_err").hide();
        $("#create").click(function(){
            $("#name_err").hide();
            name = $('#name').val();
            if(name == ''){
                $("#name_err").show();
                $("#name").focus();
                return false;
            }
        });


        type = '<?php echo $data['type']?>';
        $("#type").val(type);

        status = '<?php echo $data['status']?>';
        $("#status").val(status);
    });

</script>


<form name="create_form" id="create_form" method="POST" action="?r=slidebanner/edit&id=<?php echo $data['id']?>" enctype="multipart/form-data">
    <div class="left-panel">
        <h3>Thông tin cơ bản</h3><hr />
        <table border="0">
            <tr>
                <td><label for="normal">Tiêu đề ảnh</label></td>
            </tr>
            <tr>
                <td>
                    <input name="title" id="name"  type="text" size="70" value="<?php echo $data['title']?>" style="width:397px">
                    <label id="name_err" style="display:none;color:red;">Chưa nhập tiêu đề ảnh</label>
                </td>
            </tr>
            <tr>
                <td><label for="normal">Link</label></td>
            </tr>
            <tr>
                <td>
                    <input name="link" id="link"  type="text" size="70" value="<?php echo $data['link']?>" style="width:397px">
                </td>
            </tr>
        </table>
        <br /><br />
        <input type="hidden" id="images" />
        <input type="hidden" id="icon"/>
        <input type="hidden" id="screenshots" />
        <table border="0">
            <tr>
                <td>
                    <label for="normal">Upload ảnh</label>
                    <input name="slidebanner" id="thumb" type="file"  size="20" style="opacity: 0;">
                    <input type ="hidden" name="image" value="<?php echo $data['image']?>" id="thumb_url"/>
                </td>
            </tr>
            <tr>
                <td>
                    <div><img id="thumb_content" src="<?php echo $data['image']?>" style="width:200px;height:200px;margin-top:15px"/></div>
                    <div id="thumb_status"></div>
                </td>
            </tr>
        </table>
        <span style="clear:left"></span>

        <br /><br />
        <center>
            <button class="btn" id="create" href="#"><span class="icon16 icomoon-icon-cog"></span> Update</button>
            <button class="btn" id="cancel" href="?r=slidebanner"><span class="icon16 icomoon-icon-cog"></span> Cancel</button>
        </center>
    </div>

    <div class="right-panel">
        <h3>Thông tin liên quan </h3><hr />
        <label for="normal" style="width:240px">Trạng thái</label>
        <select name="status" id="status" style="opacity: 0;">
            <option value ="active" selected="selected">Active</option>
            <option value="blocked">Blocked</option>
        </select><br /><br />

        <label for="normal" style="width:240px">Loại</label>
        <select name="type" id="type" style="opacity: 0;">
            <option value ="slide" selected="selected">Slide</option>
            <option value="banner">Banner</option>
        </select><br /><br />
    </div>
    <span style="clear: both"></span>
</form>